function restore(id) {
    console.log("当前id为----------------------------------"+id);
    layer.confirm('确定要还原吗？',
        {btn: ['还原','取消'],
            yes:function () {
                $.ajaxSettings.async = false;
                $.post("/document/cateupdate","id="+id,function (data) {
                    if (data>0){
                        layer.alert('还原数据成功！', {
                            skin: 'layui-layer-lan'
                            , closeBtn: 0
                            , anim: 3 //动画类型
                        });
                        setTimeout(" window.location.href='/document/sellrecycler'",1000);
                    }else {
                        layer.alert('还原数据失败！', {
                            skin: 'layui-layer-lan'
                            , closeBtn: 0
                            , anim: 3 //动画类型
                        });
                        setTimeout(" window.location.href='/document/sellrecycler'",1000);
                    }
                })
                $.ajaxSettings.async = true;
            }
        })

}

function redel(id) {
    console.log("当前id为----------------------------------"+id)
    layer.confirm('确定要删除吗？',
        {btn: ['删除','取消'],
            yes:function () {
                $.ajaxSettings.async = false;
                $.post("/document/redel","id="+id,function (data) {
                    if (data>0){
                        layer.alert('删除数据成功！', {
                            skin: 'layui-layer-lan'
                            , closeBtn: 0
                            , anim: 3 //动画类型
                        });
                       ;
                        setTimeout(" window.location.href='/document/sellrecycler'",1000);
                    }else {
                        layer.alert('删除数据失败！', {
                            skin: 'layui-layer-lan'
                            , closeBtn: 0
                            , anim: 3 //动画类型
                        });
                        setTimeout(" window.location.href='/document/sellrecycler'",1000);
                    }
                })
                $.ajaxSettings.async = true;
            }
        })
}

$(function(){
    //$('table tr:not(:first)').remove();
    var len = $('table tr').length;
    for(var i = 2;i<len;i++){
        var num =$('table tr:eq('+i+') td:first').text(i-1);
    }

});